package com.stars.home.vmodel

import android.app.Activity
import android.app.Application
import android.view.View
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.viewModelScope
import com.stars.home.activity.CertificationActivity
import com.stars.home.activity.ChosePlaceActivity
import com.stars.home.config.MIntentAction
import com.stars.home.update.bean.UpdateBean
import com.stars.home.utils.net.NetEngine
import com.trailer.base.base.BRepository
import com.trailer.base.base.BViewModel
import com.trailer.base.utils.B
import com.trailer.base.utils.UiSwitch
import kotlinx.coroutines.launch

/**
 *
 *on 2021/3/3
 */
class MainVModel(application: Application) : BViewModel<BRepository>(application) {




    var bean= MutableLiveData<UpdateBean>()


    fun getAppConfig(){
        viewModelScope.launch {
            var it=repository().lreq { NetEngine.service.payOrder("1") }
            if(it.ok()){
                bean.value=it.data
            }

        }
    }

    //连续上传位置
    fun toUpdateLocation(lat: String, lng: String){
        viewModelScope.launch {
            var it= NetEngine.service.updateTechnicianPosition(lat,lng)
            if(it.ok()){

            }
        }
    }

}
